package com.anti.core.context;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description TODO
 * @Author anTi
 * @Date 2020-10-21
 */
@Component
public class PropertyHelper {
    /*自定义配置信息储存器*/
    private static Map<String,String> customPropertiesMap=new HashMap<String,String>();

    public static void initPropertyMap(Map map){
        customPropertiesMap=map;
    }
    public static String get(String key) {
        return customPropertiesMap.get(key);
    }

    public static String get(String key, String defaultValue) {
        String value = customPropertiesMap.get(key);
        return value == null ? defaultValue : value;
    }
}
